package com.rede.didiok.user.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rede.didiok.user.entity.UserEntity;

/**
 * 用户表
 * 
 * @author Rede
 * @email didiok@foxmail.com
 * @date 2023-08-07 18:21:17
 */
@Mapper
public interface UserDao extends BaseMapper<UserEntity> {
    /**
     * 修改用户积分 默认为加   如果是减   传递负值
     *
     * @param userUid
     * @param credits
     */
    void updateCreditsByUserUid(@Param("userUid") String userUid, @Param("credits") Integer credits);

    /**
     * 更新用户经验值
     * @param userUid
     * @param expValue
     */
    void updateExpValueByUserUid(@Param("userUid") String userUid, @Param("expValue") Integer expValue);

    /**
     * 获取用户排名
     *
     * @param userUid
     * @return
     */
    Integer getUserRank(@Param("userUid") String userUid);

    /**
     * 更新用户余额
     * @param userUid
     * @param operateAmount
     */
    void updateAmountByUserUid(@Param("userUid") String userUid, @Param("operateAmount") Long operateAmount);

    /**
     * 获取用户信息：username，avatar
     * @param uids
     * @return
     */
    List<UserEntity> listUserNameAndAvatarByUids(@Param("uids") List<String> uids);
}
